package com.intelij.adapter.source;

import com.intellij.diagram.DiagramNode;
import org.jdom.Element;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

public class UmlSupportSource implements Source<Element> {
    private Element source;

    public UmlSupportSource(Element element) {
        this.source=element;
    }

    /**
     * 在适配成Document前将一些适配需要的值就行填充
     * @return
     */
    @Override
    public Element getSource() {
        //todo diagramState中的类名称判断是否是接口还是类，并将信息填充到UmlSupport中
        return source;
    }

    private Map<String, String> getTypeMap(Element element) {
        element.getContent().forEach(f->{
            Element e=(Element)f;

        });
        element.getContent(0);
        Collection<DiagramNode> nodes;
        Map<String, String> typeMap = new HashMap<>();
    /*    nodes.stream().forEach(k->{
            try {
                Class cls = Class.forName();
                typeMap.put(k.substring(k.lastIndexOf("."), k.length()), cls.getTypeName());
                System.out.println(cls.getTypeName());
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            }
        });*/
        return typeMap;
    }
}
